<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:cc="http://java.sun.com/jsf/composite/customcomponents"
	contentType="text/html">
	
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title><h:outputText value="#{label['admin.properties.title']} - #{label['appNameTitle']}"/></title>
	</h:head>	
	<h:body>
		<cc:LatamHeader userInfo="true">
			<cc:AdminHeaderMenu/>
		</cc:LatamHeader>

		<h:form id="form">
			<p:growl id="growl" showDetail="false" showSummary="true" severity="INFO,WARN,ERROR"/>
			<p:panel styleClass="latam_body_panel" style="height: 560px;">
				<p:fieldset legend="#{label['admin.properties.title']}" toggleable="false" collapsed="false">
					<p:dataTable var="file" value="#{examplePropertiesViewer.propertiesFileList}">  
				        <p:column headerText="#{label['admin.properties.filename']}">  
				            <h:outputText value="#{file.name}" />  
				        </p:column>  
				  
				        <p:column headerText="#{label['admin.properties.actions']}">
					        <p:commandButton icon="ui-icon-document" value="#{label['admin.properties.action.view']}"
					        		update="@form" 
					        		oncomplete="PF('dlg').show();" 
					        		action="#{examplePropertiesViewer.setActualPropertiesFileName(file.name)}" />  
				        </p:column> 
	    			</p:dataTable>
	    			<br/>
	    			<br/>
					<h:outputLabel value="#{label['admin.properties.disclaimer']}" style="font-size:14px; color:red;" escape="false"/>
				
					<p:dialog id="dialog" widgetVar="dlg" 
						header="#{label['admin.properties.dialog.title']} &quot;#{examplePropertiesViewer.actualPropertiesFileName}&quot;"  
						modal="true" draggable="false" closable="true" resizable="false" 
						dynamic="true"
						showEffect="clip" hideEffect="drop">
						<p:panel id="tablePanel">
						    <p:dataTable id="dataTable" widgetVar="actualPropertiesTable"
						    	width="400" height="450" 
						    	var="property" value="#{examplePropertiesViewer.actualPropertiesList}" 
						    	filteredValue="#{examplePropertiesViewer.filteredActualPropertiesList}"    
						        emptyMessage="#{label['admin.properties.dialog.empty']}"
						        sortBy="key"
						        >
						        <p:column id="nameColumn"
						        	headerText="#{label['admin.properties.dialog.key']}" 
						            filterBy="key" filterMatchMode="contains">
						            <h:outputText value="#{property.key}" style="font-family: Courier, Monospace;"/>
						        </p:column>  
						  
						        <p:column id="valueColumn" 
						        	headerText="#{label['admin.properties.dialog.value']}" 
						        	filterBy="value" filterMatchMode="contains">
						            <h:outputText value="#{property.value}" style="font-family: Courier, Monospace;"/>
						        </p:column>  
						  		
						    </p:dataTable>  
					    </p:panel>
					</p:dialog>
					
				</p:fieldset>
			</p:panel>			
		</h:form>
		<cc:LatamFooter/>
	</h:body>
</f:view>